<template>
  <div>
    <div v-for="item in nodes">
      <el-submenu :index="item.id" v-if="item.children.length">
        <template slot="title">
          <i v-if="item.icon" :class="item.icon"></i>
          <span>{{item.name}}</span>
        </template>
        <ue-menu :nodes="item.children"></ue-menu>
      </el-submenu>
      <el-menu-item v-else :index="item.path">
        <i v-if="item.icon" :class="item.icon"></i>
        <span>{{item.name}}</span>
      </el-menu-item>
    </div>
  </div>
</template>

<script>
  export default {
    props: ['nodes'],
    data () {
      return {
        nodes: [
          {id: 1, icon: null, name: 2, children: null}
        ]
      };
    }
  };
</script>
